﻿<Page x:Class="WpfBinding.StringFormatDemo"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:WpfBinding"
      mc:Ignorable="d" 
      d:DesignHeight="321" d:DesignWidth="745"
	Title="StringFormatDemo">
    <Page.Resources>
        <local:ItemsCollection x:Key="data" />
    </Page.Resources>
    <Grid>
        <ListView Height="184" ItemsSource="{StaticResource data}" HorizontalAlignment="Left" Margin="62,53,0,0" Name="listView1" VerticalAlignment="Top" Width="172" >
            <ListView.View>
                <GridView>
                    <GridViewColumn  DisplayMemberBinding="{Binding Descript,StringFormat=Desc:{0}}" Header="Descirpt"/>
                    <GridViewColumn  DisplayMemberBinding="{Binding Price,StringFormat={}{0:C}}" Header="Price"/>
                </GridView>
            </ListView.View>
        </ListView>
        <ListView Height="184" ItemsSource="{StaticResource data}" HorizontalAlignment="Left" Margin="312,53,0,0" Name="listView2" 
                  VerticalAlignment="Top" Width="172" >
            <ListView.ItemTemplate>
                <DataTemplate>
                    <TextBlock >
                        <TextBlock.Text>
                            <MultiBinding StringFormat="Descript:{0} Price:{1:C}">
                                <Binding  Path="Descript" />
                                <Binding  Path="Price" />
                            </MultiBinding>
                        </TextBlock.Text>
                    </TextBlock>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
    </Grid>
</Page>
